use crate::{PublicKeyBytes, PublicKeyHashBytes};

pub mod account;
pub mod wallet_cache;
pub mod wallet_tx;

#[derive(thiserror::Error, Debug, PartialEq)]
pub enum WalletBaseError {
    #[error("public key not exists")]
    PubKeyNotExists(PublicKeyBytes),

    #[error("public key hash not exists")]
    PubKeyHashNotExists(PublicKeyHashBytes),

    #[error("public key already exists")]
    PubKeyAlreadyExists(String),

    #[error("public key hash already exists")]
    PubKeyHashAlreadyExists(String),
}

#[derive(Debug, PartialEq)]
pub struct ItemNumberInWalletDb {
    pub account_key_pair_number: usize,
    pub account_name_number: usize,
    pub default_key_number: usize,
    pub wallet_tx_number: usize,
}

impl ItemNumberInWalletDb {
    pub fn new() -> Self {
        Self {
            account_key_pair_number: 0,
            account_name_number: 0,
            default_key_number: 0,
            wallet_tx_number: 0,
        }
    }
}

impl Default for ItemNumberInWalletDb {
    fn default() -> Self {
        Self::new()
    }
}
